package com.example.demo.mapper;

import com.example.demo.entity.Idempotent;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface IdempotentMapper {

    @Insert("insert into idempotent(tenantId, createdAt, lastModifiedAt, paramMd5) values(#{tenantId}, #{createdAt}, #{lastModifiedAt}, #{paramMd5})")
    int insert(Idempotent idempotent);

    @Select("select * from idempotent where tenantId = #{tenantId} and paramMd5 = #{paramMd5} ")
    Idempotent selectByTenantIdAndParaMd5(@Param("tenantId") Long tenantId, @Param("paramMd5") String paramMd5);
}
